from django.urls import path
from rest_framework.routers import SimpleRouter

from .views import DiarylikeViewSet, DiaryHotViewSet, DiaryViewSet, DiaryCollectViewSet, DiaryDetailViewSet

app_name = 'diary'
urlpatterns = [
    path('hot/', DiaryHotViewSet.as_view()),  # 热日志
    path('<int:pk>/detail/', DiaryDetailViewSet.as_view()),  # 热日志
    path('<int:id>/like/', DiarylikeViewSet.as_view()),  # 点赞
    path('<int:id>/collect/', DiaryCollectViewSet.as_view()),  # 收藏
]
router = SimpleRouter()
router.register('', DiaryViewSet)  # 单个用户的日志操作，增删查
urlpatterns += router.urls
